<?php
/**
 * @file functions.php
 * @package V2
 * @subpackage 
 * @version $id: 0.1 UTF-8 2009-8-2 下午03:20:07 $
 * @author LD King (mifunny.info)
 * @copyright Copyright (c) 2007 - 2009 MiFunny China Inc. (http://mifunny.info)
 */
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wlwmanifest_link');
//remove_action('wp_head', 'rsd_link');


function getKeywords($ID){
	$keywords = '';
	$tags = wp_get_post_tags($ID); 
	foreach($tags as $tag){
		$keywords .= $tag->name . ", "; 
	}
	return 	$keywords;
}


function getTags($num){
	$tArray = wp_tag_cloud("number={$num}&echo=0&format=array&orderby=count");

	$tags = array();
	foreach ($tArray as $t){
		$matches = array();
		preg_match('/<a href=\'(.*)\' class=.*>(.*)<\/a>/', $t, $matches, PREG_OFFSET_CAPTURE);
		array_push($tags, "<a href=\"{$matches[1][0]}\" title=\"tag link to {$matches[2][0]}\" >{$matches[2][0]}</a>");
	}
	return $tags;
}
?>